<?php
class SeriesController extends Zend_Controller_Action
{

    public function init()
    {
        /* Initialize action controller here */
    //	$this->_helper->layout->setLayout ( 'layout' );

    }
    public function indexAction()
    {
    	$criteria = new Criteria();
		$criteria->add(TournamentPeer::IS_ACTIVE, 'Y');		
		$tournaments = TournamentPeer::doSelect($criteria);		
		$this->view->tournaments = $tournaments;
    }
	public function viewAction()
    {
    	$tournamentId = $this->_getParam('id');
    	
    	//Condtion to retrieve match schedule for particular tournament 	    	
	    	$oMatch = Default_Service_Tournament::getMatchSchedule($tournamentId);
	    	$this->view->match = $oMatch;

	    //Condition to retrieve teams available in tournament
	       	$oTourToTeam = Default_Service_Tournament::getAllTeam($tournamentId);
	    	$this->view->tourtoteam = $oTourToTeam;
    	
	    //Condtion to retrieve top teams in tournament		    	
			$userTeam = Default_Service_Tournament::getTopTeams($tournamentId);			
			$this->view->userTeam = $userTeam;
			
	    //Condition to retrieve league in tournament
			$oLeague = Default_Service_Tournament::getLeagues($tournamentId);			
			$this->view->league = $oLeague;
			
		//Condtion to retrieve news
			$newsUrl = "http://in.news.yahoo.com/rss/cricket";
    		$str = simplexml_load_file($newsUrl); 
    		$this->view->xml 	  = $str;	
			
    	 $this->view->tournamentId = $tournamentId; 	
    }
}  